﻿
<!DOCTYPE html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="~/css/table.css" rel="stylesheet" />
    <link href="~/css/cwcalendar.css" rel="stylesheet" />
    <script src="~/javascript/calendar-ch.js"></script>
    <script src="~/javascript/comm/comm.js"></script>
    <script src="~/javascript/comm/list.js"></script>
    <script src="~/javascript/jquery-1.7.2.js"></script>
    <script src="~/javascript/locate.js"></script>
    <script src="~/javascript/select.js"></script>
    <script src="~/javascript/comm/time.js"></script>
    <script type="text/javascript">
        window.onload = check;
        function tick() {
            var now = new Date();
            var hours, minutes, seconds, noon;
            var intHours, intMinutes, intSeconds;
            intHours = now.getHours();
            intMinutes = now.getMinutes();
            intSeconds = now.getSeconds();
            if (intHours < 24) {
                hours = intHours + ":";
                noon = "A.M.";
            } else {
                intHours = intHours - 24;
                hours = intHours + ":";
                noon = "P.M.";
            }
            if (intMinutes < 10) {
                minutes = "0" + intMinutes + ":";
            } else {
                minutes = intMinutes + ":";
            }
            if (intSeconds < 10) {
                seconds = "0" + intSeconds + " ";
            } else {
                seconds = intSeconds + " ";
            }
            timeString = hours + minutes + seconds;
            var now = new Date();
            document.getElementById("change_time").value = now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate() + " " + timeString;
            window.setTimeout("tick();", 1000);
        }
        //load事件
        function check() {
            //获得系统当前时间的方法
            tick();
        }
    </script>
</head>
<body>
    <div id="app">
        <form id="form1">
            <table width="100%">
                <tr>
                    <td>
                        <font color="black">您正在做的业务是：人力资源--招聘管理--职位发布管理--职位发布变更 </font>
                    </td>
                </tr>
                <tr>
                    <td align="right">
                        <input type="button" v-on:click="Update()" value="提交" class="BUTTON_STYLE1">
                        <input type="reset" value="清除" class="BUTTON_STYLE1">
                    </td>
                </tr>
            </table>
            <table width="100%" border="1" cellpadding=0 cellspacing=1
                   bordercolorlight=#848284 bordercolordark=#eeeeee
                   class="TABLE_STYLE1">
                <tr hidden>
                    <td width="19%" class="TD_STYLE1">
                        编号
                    </td>
                    <td width="81%" class="TD_STYLE2">
                        <input type="text" id="mre_id" name="mre_id" v-model="mre_id" hidden />
                    </td>
                </tr>

                <tr>
                    <td class="TD_STYLE1" width="11%">
                        I级机构
                    </td>
                    <td width="14%" class="TD_STYLE2">
                        <input type="hidden" id="first_kind_id" name="first_kind_id" v-model="first_kind_id" value="01" />
                        <input type="text" id="first_kind_name" name="first_kind_name" v-model="first_kind_name" readonly="readonly" class="INPUT_STYLE1" value="集团">
                    </td>
                    <td width="11%" class="TD_STYLE1">
                        II级机构
                    </td>
                    <td width="14%" class="TD_STYLE2">
                        <input type="hidden" v-model="second_kind_id" id="second_kind_id" name="second_kind_id" />
                        <input type="text" v-model="second_kind_name" id="second_kind_name" name="second_kind_name" class="INPUT_STYLE1" />
                    </td>
                    <td width="11%" class="TD_STYLE1">
                        III级机构
                    </td>
                    <td class="TD_STYLE2">
                        <input type="hidden" readonly="readonly" class="INPUT_STYLE1" v-model="third_kind_id" id="third_kind_id" name="third_kind_id" />
                        <input type="text" readonly="readonly" class="INPUT_STYLE1" v-model="third_kind_name" id="third_kind_name" name="third_kind_name"  />
                    </td>
                    <td width="11%" class="TD_STYLE1">
                        招聘类型
                    </td>
                    <td class="TD_STYLE2" colspan="2">

                        <select name="engage_type" id="engage_type" class="SELECT_STYLE1" v-model="engage_type">
                            <option value="校园招聘">校园招聘</option>

                            <option value="社会招聘">社会招聘</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        职位分类
                    </td>
                    <td class="TD_STYLE2">
                        <input type="hidden" name="major_kind_id" id="major_kind_id" v-model="major_kind_id" />
                        <input type="text" id="major_kind_name" name="major_kind_name" v-model="major_kind_name" class="INPUT_STYLE1" />
                    </td>
                    <td class="TD_STYLE1">
                        职位名称
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" id="major_name" name="major_name" v-model="major_name" class="INPUT_STYLE1"/>
                        <input type="hidden" name="major_id" id="major_id" v-model="major_id" />
                    </td>
                    <td class="TD_STYLE1">
                        招聘人数
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="human_amount" id="human_amount" v-model="human_amount" class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        截止日期
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="deadline" v-model="deadline" class="INPUT_STYLE2" id="deadline" onclick="aa('deadline')">
                    </td>
                </tr>
                <tr hidden>
                    <td class="TD_STYLE1">
                        登记人
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="register" value="susu" v-model="register" class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        登记时间
                    </td>
                    <td class="TD_STYLE2">

                        <input type="text" name="regist_time"
                               id="regist_time" readonly="readonly" v-model="regist_time"
                               class="INPUT_STYLE2">
                    </td>

                    <td>&nbsp; </td>
                    <td>&nbsp; </td>
                    <td>&nbsp; </td>
                    <td>&nbsp; </td>

                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        变更人
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" id="changer" name="changer" v-model="changer" class="INPUT_STYLE2">
                    </td>
                    <td class="TD_STYLE1">
                        变更时间
                    </td>
                    <td class="TD_STYLE2">
                        <input type="text" name="change_time"
                               id="change_time" readonly="readonly" v-model="change_time"
                               class="INPUT_STYLE2">
                    </td>

                    <td>&nbsp; </td>
                    <td>&nbsp; </td>
                    <td>&nbsp; </td>
                    <td>&nbsp; </td>

                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        职位描述
                    </td>
                    <td class="TD_STYLE2" colspan="8">
                        <textarea name="major_describe" id="major_describe" v-model="major_describe" rows="4" cols="100%" class="TEXTAREA_STYLE1"></textarea>
                    </td>

                </tr>
                <tr>
                    <td class="TD_STYLE1">
                        招聘要求
                    </td>
                    <td class="TD_STYLE2" colspan="8">
                        <textarea name="engage_required" id="engage_required" v-model="engage_required" rows="4" cols="100%" class="TEXTAREA_STYLE1"></textarea>
                    </td>

                </tr>
            </table>
        </form>
    </div>
</body>
<script type="text/javascript">
    var vm = new Vue({
        el: "#app",
        data: {
            mre_id:"",
            first_kind_id: "",
            first_kind_name: "",
            second_kind_id: "",
            second_kind_name: "",
            third_kind_id: "",
            third_kind_name: "",
            engage_type: "",
            major_kind_id: "",
            major_kind_name: "",
            major_id: "",
            major_name: "",
            human_amount: "",
            engage_type: "",
            deadline: "",
            changer: "",
            change_time:"",
            register: "",
            regist_time: "",
            major_describe: "",
            engage_required: "",
        },
        methods: {
             load: function () {
                var t = this;
                $.ajax({
                    url: "/position/position_release_change1",
                    type: "Post",
                    data:"id="+@ViewData["id"],
                    success: function (msg) {
                        var dt = eval("("+msg+")");
                        t.mre_id = dt.mre_id;
                        t.second_kind_name = dt.second_kind_name;
                        t.second_kind_id = dt.second_kind_id;
                        t.first_kind_id = dt.first_kind_id;
                        t.first_kind_name = dt.first_kind_name;
                        t.third_kind_id = dt.third_kind_id;
                        t.third_kind_name = dt.third_kind_name;
                        t.major_kind_id = dt.major_kind_id;
                        t.major_kind_name = dt.major_kind_name;
                        t.major_id = dt.major_id;
                        t.major_name = dt.major_name;
                        t.human_amount = dt.human_amount;
                        t.engage_type = dt.engage_type;
                        t.deadline = dt.deadline;
                        t.register = dt.register;
                        t.changer = dt.changer;
                        t.regist_time = dt.regist_time;
                        t.change_time = dt.change_time;
                        t.major_describe = dt.major_describe;
                        t.engage_required = dt.engage_required;
                    }
                });
            },
            Update: function () {
                var human_amount = $("#human_amount").val();
                var deadline = $("#deadline").val();
                var changer = $("#changer").val();
                var change_time = $("#change_time").val();
                var major_describe = $("#major_describe").val();
                var engage_required = $("#engage_required").val();

                if (human_amount == "") {
                    alert('请输入招聘人数！！！');
                    return false;
                } else if (deadline == "") {
                    alert('请输入截止日期！！！');
                    return false;
                } else if (changer == "") {
                    alert('请输入变更人！！！');
                    return false;
                } else if (change_time == "") {
                    alert('请输入变更时间！！！');
                    return false;
                } else if (major_describe == "") {
                    alert('请输入职位描述！！！');
                    return false;
                } else if (engage_required == "") {
                    alert('请输入招聘要求！！！');
                    return false;
                }
                
                $.ajax({
                    url: "/position/position_release_change",
                    type: "put",
                    data: $("#form1").serialize(),
                    success: function (msg) {
                        if (msg > 0) {
                            alert("修改成功！")
                            location.href = "/position/position_change_update";
                        }
                    }
                });
            }
        },
        mounted: function () {
            this.load();
        }
    });
</script>

